package br.edu.granbery.indianostore.controller;

public class ActionFactory {
	  public static Action create(String action){
	    Action actionObject = null;
	    String nomeClasse = "br.edu.granbery.indianostore.action." + action + "Action";
	    Class classe = null;
	    Object object = null;
	    try {
	      classe = Class.forName(nomeClasse);
	      object = classe.newInstance();
	    } catch (Exception ex) {
	      return null;
	    }
	    if(!(object instanceof Action)) return null;
	    actionObject = (Action) object;
	    return actionObject;
	  }
	}

